package com.geostar.constructionland.statistics.service.factory.impl;

import com.geostar.constructionland.common.entity.statistics.UnifiedDataQueryConfig;
import com.geostar.constructionland.statistics.mapping.QueryMappedStatement;
import com.geostar.constructionland.statistics.mapping.ResultTypeStatement;
import com.geostar.constructionland.statistics.service.factory.IResultCustomWorker;
import org.springframework.stereotype.Component;

/**
 * @Author makoto_zhu
 * @Date 2020-12-18 04:06:34
 * @Description
 **/
@Component
public class ResultCustomWorkerImpl implements IResultCustomWorker {
    @Override
    public void createResult(QueryMappedStatement queryMappedStatement, UnifiedDataQueryConfig unifiedDataQueryConfig) {
        ResultTypeStatement statement = new ResultTypeStatement();

        statement.setPrecision(unifiedDataQueryConfig.getPrecisionVal());
        statement.setResultType(unifiedDataQueryConfig.getResultType());
        statement.setHtmlTemplate(unifiedDataQueryConfig.getHtmlTemplate());

        queryMappedStatement.setResultTypeStatement(statement);
    }
}
